package com.neu.elm.controller;

import com.neu.elm.po.Food;
import com.neu.elm.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:csw
 * @Date: 9:10 2020/9/16
 */
@RestController
@RequestMapping("/FoodController")
public class FoodController {

    @Autowired
    private FoodService foodService;

    //http://localhost:8088/elm/FoodController/listFoodByBusinessId?businessId=10002
    @RequestMapping("/listFoodByBusinessId")
    public List<Food> listFoodByBusinessId(Food food) throws Exception{
        return foodService.listFoodByBusinessId(food.getBusinessId());
    }
}
